@@ -222,34 +222,27 @@ def get_import_status(session: Session = None) -> List[MapFile]:
222222
223223
224224# Calculated using many tests on a well-cooled RPi4 (4GB).
225- RPI4_PBF_BYTES_PER_SECOND = 61879
226- RPI4_A = 7.17509261732342e-14
227- RPI4_B = 6.6590760410412e-5
228- RPI4_C = 10283
225+ RPI4_PBF_BYTES_PER_SECOND = 175473
226+ RPI4_COEFFICIENTS = [4.01229956e-15 , 7.19038150e-06 , - 1.36868043e+02 ]
229227# Calculated using many tests on a well-cooled RPi5 (8GB).
230228RPI5_PBF_BYTES_PER_SECOND = 136003
231- RPI5_A = 1.6681382703586e-15
232- RPI5_B = 2.35907824676145e-6
233- RPI5_C = 53.727
229+ RPI_5COEFFICIENTS = [1.66813827e-15 , 2.35907825e-06 , 5.37276181e+01 ]
234230
235231
236232def seconds_to_import_rpi4 (size_in_bytes : int ) -> int :
237233 if size_in_bytes > 1_000_000_000 :
238234 # Use exponential curve for large files.
239- a = RPI4_A * size_in_bytes ** 2
240- b = RPI4_B * size_in_bytes
241- return int (a - b + RPI4_C )
235+ a , b , c = RPI4_COEFFICIENTS
236+ return int (a * size_in_bytes ** 2 + b * size_in_bytes + c )
242237 # Use simpler equation for small files.
243238 return max (int (size_in_bytes // RPI4_PBF_BYTES_PER_SECOND ), 0 )
244239
245240
246241def seconds_to_import_rpi5 (size_in_bytes : int ) -> int :
247- if size_in_bytes > 5_000_000_000 :
242+ if size_in_bytes > 1_000_000_000 :
248243 # Use exponential curve for large files.
249- a = RPI5_A * size_in_bytes ** 2
250- b = RPI5_B * size_in_bytes
251- return int (a - b + RPI5_C )
252- # Use simpler equation for small files.
244+ a , b , c = RPI_5COEFFICIENTS
245+ return int (a * size_in_bytes ** 2 + b * size_in_bytes + c )
253246 return max (int (size_in_bytes // RPI5_PBF_BYTES_PER_SECOND ), 0 )
254247
255248
0 commit comments