This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/tests/Symfony/Tests/Component
Fabien Potencier ed472d36b7 merged branch alexandresalome/new-profiler-storage (PR #1772)
Commits
-------

9f0bd03 [HttpKernel] Update tests for FileProfilerStorage
b7032bc [HttpKernel] Update FileProfileStorage to search from EOF
188a5fa [HttpKernel] Override the existing tokens in FileProfilerStorage
b1b1424 [HttpKernel] Delete folders in the profiler cache
88bc3ec [HttpKernel] Fixes standards of FileProfilerStorage
affe66c Merge remote-tracking branch 'origin/master' into new-profiler-storage
ea916c3 [HttpKernel] Coding convention for the file profiler storage
9ae2c8d [HttpKernel] CS in file storage
b415efd [HttpKernel] Add a test for semicolon in file storage test
1c1215f [HttpKernel] Use subfolders for better storage in file storage of profiler
4b1dc1f [HttpKernel] Fix the folder attribute of file storage to private
70f73e1 [HttpKernel] Fix tests for the file storage of profiler
d5313d9 [HttpKernel] Add tests for the file profiler storage
09fc0a2 [HttpKernel] Add Symfony credits to the file storage class for the profiler
d1d5892 [HttpKernel] Finalize the file storage for the profiler
2f65cf2 Add POC for file storage system

Discussion
----------

[2.1] [HttpKernel] File storage for profiler

Symfony2 has some problems when dealing with multiple concurrency queries in the SQLite storage, resulting in a timeout error or terrible lack.

I've implemented after discussions with @fabpot a filesystem storage.

Enable it in your project with :

    framework:
        profiler:
          dsn:             "file:%kernel.cache_dir%/profiler"

I also studied the possibility to store only big data string in files and rest in the SQLite, but not concluant.

Results of my measures (4 concurrency, 120 total) :

* SQLite with data : 1057ms
* SQLite without data : 615ms
* MySQL : 40ms
* This File storage : 54ms

---------------------------------------------------------------------------

by alexandresalome at 2011/07/22 12:01:10 -0700

An idea for the find method : a csv file containing ip;url;token

The iteration could be done over a big file, without loading the whole file in memory.

---------------------------------------------------------------------------

by alexandresalome at 2011/07/23 14:22:32 -0700

OK new version, with as explained previously : a CSV file containing the index + file for each profile.

The speed is similar to the speed of MySQL, and no memory overhead should occur with this solution.

---------------------------------------------------------------------------

by alexandresalome at 2011/07/23 14:37:14 -0700

Hm... Created tests, duplicated from SqliteProfilerStorageTest.

Any idea on how to put this code in common ? Is it usual to create a base class for 2 tests ?

---------------------------------------------------------------------------

by alexandresalome at 2011/07/23 14:48:39 -0700

Just tested with 24.000 requests, the 24.001'th request still takes less than 50ms to execute.

The index file is about 2Mb, and iterating the whole file is fast.

---------------------------------------------------------------------------

by alexandresalome at 2011/07/23 14:53:19 -0700

I've filled the file with 120Mb of data, requests are still less than 50ms for executing.

Iterating the index takes more than 30s (so it crashed), but it's because of the amount of lines. 30 seconds = 1,400,000 lines in this computer. The file = 1,500,000 lines

---------------------------------------------------------------------------

by alexandresalome at 2011/07/23 14:56:54 -0700

I've tested it with Linux, is someone can test with Windows

---------------------------------------------------------------------------

by stloyd at 2011/07/24 00:32:32 -0700

IMO to speedup it a bit more and not end up with "crash" (to not end with "limit" of files per directory, also to many files in dir slow down every OS) you should use same method to write as Twig, split up files in to directories. If you do this you can speed up index more, because you can create smaller one per directory.

Also you should fix CS (coding standards).

---------------------------------------------------------------------------

by stloyd at 2011/07/24 02:10:20 -0700

Tested on Win 7, seems ok. Similar speed to sqlite, dunno why ;-) but used a bit less of memory.

---------------------------------------------------------------------------

by alexandresalome at 2011/07/24 02:13:21 -0700

Did you tried with concurrent requests ? It makes sense when you use assetic
and your browser hits the application 4 times simultaneously for CSS
generation

---------------------------------------------------------------------------

by alexandresalome at 2011/07/24 02:17:23 -0700

I used Apache Benchmark for producing results :

    ab -c 4 -n 120 URL

---------------------------------------------------------------------------

by alexandresalome at 2011/07/24 02:56:55 -0700

OK I used subfolders, based on last characters (because the first part of token is mostly the same between queries.

---------------------------------------------------------------------------

by stof at 2011/09/04 01:27:15 -0700

@fabpot any news about it ? Can it be merged ?
2011-09-06 07:45:55 +02:00
..
BrowserKit [Tests] Use proper phpunit assertion functions: "assertTrue", "assertFalse", "assertNull" 2011-08-25 15:41:15 +02:00
ClassLoader [ClassLoader] Support for autoloading include_path incl. tests. 2011-08-29 13:15:35 +02:00
Config [Config] fixed a unit test 2011-07-01 10:15:26 +02:00
Console [Console] Improved checks for InputArgument and InputOption constructor's $mode parameter. 2011-08-31 23:53:00 +02:00
CssSelector UnitTest 2011-06-29 18:22:32 +02:00
DependencyInjection [Tests] Use proper phpunit assertion functions: "assertTrue", "assertFalse", "assertNull" 2011-08-25 15:41:15 +02:00
DomCrawler [Tests] Use proper phpunit assertion functions: "assertTrue", "assertFalse", "assertNull" 2011-08-25 15:41:15 +02:00
EventDispatcher [EventDispatcher] Fix removeSubscriber() to work with priority syntax 2011-08-23 16:41:08 -04:00
Finder [Finder] added a convenience method Finder::create() 2011-06-14 14:18:24 +02:00
Form [Tests] Use proper phpunit assertion functions: "assertTrue", "assertFalse", "assertNull" 2011-08-25 15:41:15 +02:00
HttpFoundation [HttpFoundation] implemented RFC6266 (Content-Disposition header) 2011-09-04 09:35:13 +02:00
HttpKernel [HttpKernel] Update tests for FileProfilerStorage 2011-08-29 15:35:28 +02:00
Locale merged branch stealth35/master (PR #1346) 2011-06-16 15:07:27 +02:00
Process [Process] Fixed tests on Windows by using escapeshellarg to escape argument 2011-07-23 18:13:57 +02:00
Routing [Routing] fixed annotation loaders for abstract classes, added more unit tests 2011-08-30 20:57:43 +02:00
Security [Tests] Use proper phpunit assertion functions: "assertTrue", "assertFalse", "assertNull" 2011-08-25 15:41:15 +02:00
Serializer fix tests 2011-06-10 01:11:51 +02:00
Templating fixed CS 2011-06-23 13:39:36 +02:00
Translation [Translation] simplified tests 2011-08-29 15:30:52 +02:00
Validator merged 2.0 branch 2011-09-04 09:28:37 +02:00
Yaml merged branch jmikola/yaml-numeric-strings (PR #1688) 2011-07-15 08:39:27 +02:00